// NOTE: You need to manually change the package name on the next line and in the line within the main function.
// This will be automated in future versions once my Netbeans powers have developed...
package bones;


import processing.core.PApplet;
import processing.xml.*;

/**
 *
 */
public class Main extends PApplet {

    public static void main(String[] args) {
        PApplet.main(new String[]{Main.class.getName()});
    }

    
    
  String restUrl = "http://query.yahooapis.com/v1/public/yql?q=%20SELECT%20*%20FROM%20geo.placemaker%20%20%0A%20WHERE%20documentURL%3D%22http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FWalter_Gropius%22%20%20%0A%20AND%20documentType%3D%22text%2Fhtml%22%20%20&format=xml";  
  XMLElement xmlResponse = new XMLElement(this, restUrl);  
  XMLElement[] placeXMLElements = xmlResponse.getChildren("results/matches/match/place");  
    
    
    public void setup() {
        
    noLoop();
 }  
      

    public void draw() {
     
    println("Found " + placeXMLElements.length + " places");        
        
    for (int i = 0; i < placeXMLElements.length; i++) {  
    String name = placeXMLElements[i].getChild(2).getContent();  
    float lat = new Float(placeXMLElements[i].getChild(3).getChild(0).getContent());  
    float lng = new Float(placeXMLElements[i].getChild(3).getChild(1).getContent());  
   
    println(i + ". " + name + " (" + lat + ", " + lng + ")");    
        
    }
 }
}
